/** 
 * @author: Sabuj kundu aka manchumahara (http://blog.manchumahara.com)
 * @copyright:  LGPL
 * @First release as an ekushey project 24.09.08
 */

/* Import plugin specific language pack */
//tinyMCE.importPluginLanguagePack('banglavkb',tinyMCE.getParam('lang_list'));
tinyMCE.importPluginLanguagePack('banglavkb','en');


var TinyMCE_BanglavkbPlugin = {
	getInfo : function() {
		return {
			longname : 'Banglavkb',
			author : 'Sabuj kundu aka manchumahara',
			authorurl : 'http://blog.manchumahara.com',
			infourl : 'http://ekushey.org/?page/Bangla-TinyMCE',
			version : "1.0"
		};
	},
	/**
	 * Returns the HTML contents of the emotions control.
	 */
	 	getControlHTML : function(cn) {
		switch (cn) {
			case "banglavkb":
				return tinyMCE.getButtonHTML(cn, 'lang_banglavkb_desc', '{$pluginurl}/images/banglavkb.gif', 'mceBanglavkb');
		}

		return "";
	},
	 
	/**
	 * Executes the mceBanglavkb command.
	 */
	execCommand : function(editor_id, element, command, user_interface, value) {
		// Handle commands
		switch (command) {
			case "mceBanglavkb":
				var template = new Array();

				template['file'] = '../../plugins/banglavkb/banglavkb.html'; // Relative to theme
				template['width'] = 500;
				template['height'] = 400;

				// Language specific width and height addons
				template['width'] += tinyMCE.getLang('lang_banglavkb_delta_width', 0);
				template['height'] += tinyMCE.getLang('lang_banglavkb_delta_height', 0);

				tinyMCE.openWindow(template, {editor_id : editor_id, inline : "yes"});

				return true;
		}

		// Pass to next handler in chain
		return false;
	}
};	 
// Adds the plugin class to the list of available TinyMCE plugins
tinyMCE.addPlugin("banglavkb", TinyMCE_BanglavkbPlugin);